#ifndef DIALOG_H
#define DIALOG_H

class PLIBEXP Dialog
{
	public:
		Dialog(HWND hParent, HINSTANCE hInst);
		virtual ~Dialog();

		int getResult();

		HWND getHWnd();
		HWND getParentHWnd();

               BOOL PostMessage(UINT Msg, WPARAM wParam = 0, LPARAM lParam = 0);
        static BOOL PostMessage(HWND hwnd, UINT Msg, WPARAM wParam = 0, LPARAM lParam = 0);


	protected:
		static BOOL FAR PASCAL topDialogProc(HWND, UINT, WPARAM, LPARAM);
		virtual BOOL dialogProc(HWND, UINT, WPARAM, LPARAM);

	protected:
		HWND		m_hParent;
		HWND		m_hDialog;
		HINSTANCE	m_hInstance;
		int			m_result;
};

inline int
Dialog::getResult()
{
	return m_result;
}

inline HWND
Dialog::getHWnd()
{
	return m_hDialog;
}

inline HWND
Dialog::getParentHWnd()
{
	return m_hParent;
}

inline BOOL 
Dialog::PostMessage(UINT Msg, WPARAM wParam /* = 0 */, LPARAM lParam /* = 0 */)
{
    return ::PostMessage(getHWnd(), Msg, wParam, lParam);
}

inline BOOL 
Dialog::PostMessage(HWND hwnd, UINT Msg, WPARAM wParam /* = 0 */, LPARAM lParam /* = 0 */)
{
    return ::PostMessage(hwnd, Msg, wParam, lParam);
}


#endif
